package test.office

import aquerius.ObjectDatabase

/**
 * @author: Yardena
 * @date: Aug 12, 2009 7:33:36 PM
 */

trait OfficeObjectMapping extends OfficeSchema with ObjectDatabase {

  type InputType = Office

  def employee = new ScalaObject with EmployeeTable {
    def eval(in: Office) = for (e <- in.employees) yield (e.name, e.id, e.dept_id, e.manager)
  }

  def department = new ScalaObject with DepartmentTable {
    def eval(in: Office) = for (e <- in.departments) yield (e.name, e.id)
  }

}

object OfficeObjectMapping extends OfficeObjectMapping 